#define  _CRT_SECURE_NO_WARNINGS 1
#include"SepList.h"
void SL_init(SL* p)
{
	p->SLp = NULL;
	p->size = p->capacity = 0;
}

void SL_print(SL* p)
{
	int i = 0;
	for (i = 0; i < p->size; i++)
	{
		printf("%d ", p->SLp[i]);
	}
}

void SL_pushback(SL* p, int x)
{
	if (p->capacity == p->size)
	{
		p->capacity = p->capacity == 0 ? 4 : (p->capacity) * 2;
		SepListDate* tmp = (SepListDate*)realloc(p->SLp, sizeof(SepListDate) * p->capacity);
		if (tmp == NULL)
		{
			printf("realloc fail\n");
			exit(-1);
		}
		p->SLp = tmp;
	}
	p->SLp[p->size] = x;
	p->size++;
}


void SL_free(SL* p)
{
	free(p->SLp);
	p->SLp = NULL;
	p->capacity = p->size = 0;
}